//
//  UILabel+Extension.swift
//  weibo10
//
//  Created by 晁岳山 on 15/10/16.
//  Copyright © 2015年 晁岳山. All rights reserved.
//

import UIKit


extension UILabel {
    //便利构造函数
    convenience init(content: String, fontSize: CGFloat = 14, color: UIColor = UIColor.darkGrayColor(), scrrenInsert: CGFloat = 0) {
        self.init()
        text = content
        font = UIFont.systemFontOfSize(fontSize)
        textColor = color
        numberOfLines = 0
        if scrrenInsert == 0 {
            textAlignment = NSTextAlignment.Center
        }else {
            preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.width - 2 * scrrenInsert
            textAlignment = .Left
        }
        sizeToFit()

    }
}